package com.yds.dubbo.basic.annotation.service;

import java.util.concurrent.CompletableFuture;

/**
 * @author liuhongzhen
 * @date 2023/3/23 17:48
 */
public interface GreetingService {

    String greeting(String name);

    /**
     * 回复招呼
     * @param name
     * @return
     */
    default String replyGreeting(String name) {
        return "Fine, " + name;
    }

    /**
     * 打招呼
     * @param name
     * @param signal
     * @return
     */
    default CompletableFuture<String> greeting(String name, byte signal) {
        return CompletableFuture.completedFuture(greeting(name));
    }
}
